<template>
<div>
  
  子输入框：<input type="text" v-model="val" />
  <button @click="click()">
    <slot />
  </button>
</div>
</template>

<script lang="ts">
 import {setupSon} from '@/hooks/com'

export default {
  props: {
    size: String,
    disabled: Boolean,
    myval: String
  },
   setup(props: any, context: any) {
  //    const val = ref("");
  //   console.log('props:', {
  //     ...props,
  //   })
  //   console.log('context.attrs:', {
  //     ...context.attrs,
  //   })
  //   const click = ()=>{
  //     console.log("子打印")
  //     context.emit("ck",val.value)
  //   }
   const {click,val} = setupSon(props, context);
    return {
      click,
      val
      
    }
  },
}
</script>